import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
//导入

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name:'login',
    component: Login,
  },
  {
    path: '/index',
    redirect:'/index/home',
    component: () => import('@/views/Index.vue'),
    children:[
     {
      path: 'home',
      name: '首页',
      meta:{
        crumb:['首页']
      },
      component: () => import('@/views/wel.vue'),
     },
    {
      path: 'staff',
      name: '员工中心',
      component: () => import('@/views/staff/staff.vue'),
    },
    {
      path: 'menu',
      name: '菜单中心',
      component: () => import('@/views/menu/menu.vue'),
    },
    {
      path: 'order',
      name: '订单中心',
      component: () => import('@/views/order/order.vue'),
    },
    ], 
  },
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
